﻿#ifndef U_TStateTool_H
#define U_TStateTool_H

#if defined(_MSC_VER) && (_MSC_VER >= 1600)
# pragma execution_character_set("utf-8")
#endif

#include <QWidget>
#include <QLabel>
#include <QTimer>
#include <QHBoxLayout>
#include <QGraphicsDropShadowEffect>

class TStateTool : public QWidget
{
    Q_OBJECT
public:
    explicit TStateTool(QString title, int type = 0, bool shadow = true, QWidget *parent = nullptr);

protected:

signals:

public slots:
    void OnTimer();

    void SetTwinkle(int time = 1000);
    void SetState(bool state);
    void SetTitleHide();
    void SetValueHide();

private:
    void InitWidget();
    void SetupConnections();
    void Initialize();

    QTimer  *timer;
    bool    twinkle;

    QString title;
    int     type;
    bool    shadow;
    bool    state;

    QLabel  *labTitle;
    QLabel  *labValue;
    QLabel  *labState;

};

#endif // U_TStateTool_H
